package cn.neusoft.neusoft_fz.controller;

import cn.neusoft.neusoft_fz.common.ResponseEntity;
import cn.neusoft.neusoft_fz.service.DeliveryOrderService;
import lombok.extern.slf4j.Slf4j;
import org.example.entity.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/task")
public class TaskController {

    @Autowired
    DeliveryOrderService deliveryOrderService;

    @GetMapping("/all/{id}")
    ResponseEntity<List<Task>> findTaskInFz(@PathVariable String id){
        List<Task> tasks = deliveryOrderService.taskInFz(id);
        return ResponseEntity.success(tasks);
    }

}
